package com.icoopoo.common.base.icoopoo.core.http;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: icoopoo@163.com
 * @Date: 2017/4/26 0026
 * @Description:
 */
public class ResponseHandler {

    public static int resultCode = 200;
    public static String message = "";

    public static Map response(Object object){
        Map<String,Object> dataCenter = new HashMap<>();
        Map<String,Object> dataStore = new HashMap<>();
        dataStore.put("resultCode",resultCode);
        dataStore.put("message", message);
        dataCenter.put("head",dataStore);
        dataCenter.put("body",object);
        resultCode = 200;
        message = "";
        return dataCenter;
    }

    public static Map errResponse(Object object){
        resultCode=-1;
        message = (String)object;
        return response("");
    }
}
